<template>
	<view class="page">

		<view>
			<view class="">
				<!-- <cu-custom> -->
					<!-- <block v-if="type == 'A'" class="title-white" slot="content">首页</block>
						<block  v-if="type !== 'A'" class="title-blue" slot="content">智慧消防</block> -->
				<!-- </cu-custom> -->
			</view>
		</view>
		<view>
			<view v-if="type == 'A'">
				<aHome ref="aHome"></aHome>
			</view>
			<view v-else-if="type == 'B'">
				<bHome ref="bHome"></bHome>
			</view>
			<view v-else-if="type == 'C'">
				<cHome ref="cHome"></cHome>
			</view>
			<view v-else-if="type == 'D'">
				<dHome ref="dHome"></dHome>
			</view>
		</view>
	</view>
</template>

<script>
	import aHome from './aHome/aHome.vue'
	import bHome from './bHome/bHome.vue'
	import cHome from './cHome/cHome.vue'
	import dHome from './dHome/dHome.vue'
	export default {
		data() {
			return {
				// type: getApp().globalData.role,
				type: getApp().globalData.role,
			}
		},
		components: {
			aHome,
			bHome,
			cHome,
			dHome
		},
		methods: {
		},
		onShow(option) {
			if (option !== undefined && option !== null && option !== "") {
				if (option.type === "refreshPage") {
					uni.showToast({
						title: "正在刷新...",
						icon: 'loading'
					})
					uni.$emit('refreshPage', {})
				}
			}
		},
		created() {
			console.info("home created")
		},
	}
</script>

<style scoped>
	.page {
		/* height: 100vh; */
		background-color: #f5f6f8;
	}
	.title-white {
		color: #777777;font-size: 32rpx;
	}
	.title-blue{
		background-color: #184382;
		color: #777777;font-size: 32rpx;
	}
</style>
